package top.sxlai.service.impl;

import top.sxlai.mapper.OpUserMapper;
import top.sxlai.service.ILogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;

import org.springframework.stereotype.Service;

/**
 * @author : sxl
 * @date : 2024/4/6 16:22
 * @Version: 1.0
 */
@Service
public class UserLogin  implements ILogin {
    public UserLogin(){}
    @Autowired
    private OpUserMapper opUserMapper;

    @Override
    public ResponseEntity<String> login(String username, String password) {
        return null;
    }
//    @Override
//    public ResponseEntity<String> login(String username, String password) {
//        OpUser opUser = opUserMapper.login(username, password);
//        Map<String,String> map = new HashMap<>();
//        if(opUser!=null){
//            //登录成功,设置token
//            String token = JwtUtil.createJWT(UUID.randomUUID().toString(), String.valueOf(opUser.getUserid()), null);
//            map.put("Authorization",token);
//            return ResponseEntity.ok(map);
//        }else {
//            //登录失败
//            return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(LoginStatus.FAILURE.getMessage());
//        }
//    }
}
